package com.svconnect.transport;

import java.lang.reflect.Type;

import com.svconnect.model.soap.SoapRequestEnvelope;

public abstract class Transport {

	private String url;
	private String username;
	private String password;
	
	private int connectionTimeout = 5000;
	private int socketTimeout = 6000;
	
	
	public Transport(String url, String username, String password) {
		super();
		this.url = url;
		this.username = username;
		this.password = password;
	}
	
	public Transport(String url) {
		super();
		this.url = url;
	}

	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public int getConnectionTimeout() {
		return connectionTimeout;
	}
	public void setConnectionTimeout(int connectionTimeout) {
		this.connectionTimeout = connectionTimeout;
	}
	public int getSocketTimeout() {
		return socketTimeout;
	}
	public void setSocketTimeout(int socketTimeout) {
		this.socketTimeout = socketTimeout;
	}	
	
	public abstract <T> T call(SoapRequestEnvelope envelope, Type returnClass, Class<?>[] exceptions) throws Exception;
	
}
